/*
 * @Author       : NaN 353362604@qq.com
 * @Date         : 2023-02-01 08:35:21
 * @LastEditTime : 2023-02-01 09:35:42
 * @LastEditors  : NaN 353362604@qq.com
 * @FilePath     : \AdminStration\src\Common\Login\LoginStyle\JSZXLoginPage.jsx
 * @Description  :
 */
import '../Scss/JSZXLoginPage.scss'
import { lazy, Suspense, useState } from 'react'
import { commonUrl } from '../../Configure/CommonParameter'
import { v4 as uuidv4 } from 'uuid'
import { PlugInUnit } from '../PlugInUnit'

const SignUp = lazy(() => import('../SignUp'))
const CodeUp = lazy(() => import('../CodeUp'))

const JSZXLoginPage = ({ imageUrl, codeState, toggle, uuid, title }) => {
    const [QRUuid] = useState(uuidv4())
    return (
        <Suspense fallback={<div>建设中心登录</div>}>
            <div className="JSZXLoginPage">
                <img className="LoginBackAmin" src={`${imageUrl}背景.png`} alt="" />
                <div className="top">
                    <img src={`${imageUrl}登录导航.png`} alt="" />
                    <div>{title}</div>
                </div>
                <img className="bottom" src={`${imageUrl}低栏.png`} alt="" />

                <div className="LoginBox">
                    <img className="LoginBoxBack" src={`${imageUrl}登录框.png`} alt="" />
                    <div className="title">登录平台</div>
                    <div className="codeTables">
                        {codeState ? (
                            <img src={`${commonUrl}二维码.png`} alt="" onClick={toggle} />
                        ) : (
                            <img src={`${commonUrl}密码码.png`} alt="" onClick={toggle} />
                        )}
                    </div>
                    <div className="SingUp">
                        {codeState ? (
                            <CodeUp
                                codeState={codeState}
                                codeStyle={commonUrl + 'code.css'}
                                QRUuid={QRUuid}
                                ProjectUuid={uuid}
                            />
                        ) : (
                            <SignUp />
                        )}
                        <PlugInUnit />
                    </div>
                </div>
            </div>
        </Suspense>
    )
}
export default JSZXLoginPage
